/**
 * Created by Dalyn on 2017/3/16.
 */
import Relay from "react-relay";

export default class ProgressMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { listOrder }`;
    }

    getVariables() {
        return {
            argsInput: {
              enId: this.props.enId,
              type: this.props.type,
              pageSize: this.props.pageSize,
              pageNum: this.props.pageNum
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on listOrderPayload {
          listOrder {
              errorCode
              value
              totalResult
              id
              orders{
                oid
                enId
                partAPhone
                profitAccount
                orderType
                rmark
                partBUserId
                traderUrl1
                traderUrl2
                partBName
                traderUrl3
                traderUrl4
                partBUserName
                traderUrl5
                createDate
                partBPhone
                partAUserName
                deliverRequest
                requirement
                purchaseAccount
                message{
                  msgDetails
                  jiaDetail
                  yiDetail
                }
                parentId
                token
                payAccount
                partAName
                orderGoodsNum
                orderGoodss{
                  productName
                  orderId
                  purpose
                  gid
                  yarnState
                  createDate
                  description
                  price
                  constituent
                  url
                  yarnTypes
                  specification
                  styleNo
                  sendQuantity
                  checkQuantity
                  quantity
                  amount
                  yarn
                  bigGoodsQua
                  acceptQuantity
                  gramWeight
                  larghezza
                  colour
                  prickle
                  desp
                }
                orderOperates{
                  money
                  fromUserName
                  cid
                  createDate
                  status
                  operaterType
                  toUserName
                  toUserPhone
                  fromUserId
                  orderId
                  operater
                  quantity
                  actualMoney
                  toId
                  fromId
                  toUserId
                  fromUserPhone
                  description
                }
                createUser
                contractId
                account
                contractUrl1
                goodsInfo
                status
                contractUrl2
                partAUserId
                contractUrl3
                contractUrl4
                contractUrl5
                partBAddress
                partA
                partB
                partAAddress
                phone
              }
          }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on listOrderPayload {
                    listOrder {
                        errorCode
                        value
                        totalResult
                        id
                        orders{
                          oid
                          enId
                          partAPhone
                          profitAccount
                          orderType
                          rmark
                          partBUserId
                          traderUrl1
                          traderUrl2
                          partBName
                          traderUrl3
                          traderUrl4
                          partBUserName
                          traderUrl5
                          createDate
                          partBPhone
                          partAUserName
                          deliverRequest
                          requirement
                          purchaseAccount
                          message{
                            msgDetails
                            jiaDetail
                            yiDetail
                          }
                          parentId
                          token
                          payAccount
                          partAName
                          orderGoodsNum
                          orderGoodss{
                            productName
                            orderId
                            purpose
                            gid
                            yarnState
                            createDate
                            description
                            price
                            constituent
                            url
                            yarnTypes
                            specification
                            styleNo
                            sendQuantity
                            checkQuantity
                            quantity
                            amount
                            yarn
                            bigGoodsQua
                            acceptQuantity
                            gramWeight
                            larghezza
                            colour
                            prickle
                            desp
                          }
                          orderOperates{
                            money
                            fromUserName
                            cid
                            createDate
                            status
                            operaterType
                            toUserName
                            toUserPhone
                            fromUserId
                            orderId
                            operater
                            quantity
                            actualMoney
                            toId
                            fromId
                            toUserId
                            fromUserPhone
                            description
                          }
                          createUser
                          contractId
                          account
                          contractUrl1
                          goodsInfo
                          status
                          contractUrl2
                          partAUserId
                          contractUrl3
                          contractUrl4
                          contractUrl5
                          partBAddress
                          partA
                          partB
                          partAAddress
                          phone
                        }
                    }
                }
            `]
        }];
    }

}
